<style lang="scss">
.header {
  .left {
    float: left;
  }
  .right {
    float: right;
  }
}

.navbar-nav > li > a {
  line-height: 24px;
}
</style>
<template>
  <header class="header">
    <nav class="navbar navbar-default">
        <div class="container">
            <div id="navbar" class="navbar-collapse">
                <ul class="nav navbar-nav left">
                    <li><a href="#"><img src="./img/zk-logo.png"></a></li>
                </ul>
                <ul class="nav navbar-nav right">
                    <li><a href="#" v-on:click="logout" >退出 </a></li>
                </ul>
            </div>
            <!--/.nav-collapse -->
        </div>
        <!--/.container-fluid -->
    </nav>
  </header>
</template>
<script>
/**
 * @author guocailee
 */
import { userLogout } from 'src/api/user'
export default {
  name: 'zkHeader',
  methods: {
    logout () {
      userLogout().then(data => {
        window.location.href = 'signin.html'
      }).catch(() => {
        window.location.href = 'signin.html'
      })
    }
  }
}

</script>